//
//  FiveViewController.m
//  UI_元旦豆瓣小集合
//
//  Created by dllo on 16/1/1.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "FiveViewController.h"

@interface FiveViewController ()

@end

@implementation FiveViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    UILabel *label = [[UILabel alloc] init];
//    self.view.backgroundColor = [UIColor redColor];
    UILabel *label2 = [[UILabel alloc] init];
    UITextField *tf = [[UITextField alloc] init];
    UITextField *tf2 = [[UITextField alloc] init];
    
    tf.frame = CGRectMake(130, 100, 200, 40);
    tf.borderStyle = UITextBorderStyleRoundedRect;
    tf.placeholder = @"请输入用户名";
    [self.view addSubview:tf];
    [tf release];
    tf2.frame = CGRectMake(130, 150, 200, 40);
    tf2.borderStyle = UITextBorderStyleRoundedRect;
    tf2.placeholder = @"请输入密码";
    [self.view addSubview:tf2];
    [tf2 release];
  
    label.frame = CGRectMake(50, 100, 70, 30);
    label.text = @"用户名:";
    [self.view addSubview:label];
    [label release];
    label2.frame = CGRectMake(50, 150, 70, 30);
    label2.text = @"密码:";
    [self.view addSubview:label2];
    [label2 release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(90, 210, 80, 30);
    button.backgroundColor = [UIColor greenColor];
    [button setTitle:@"确定" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(trueAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    button2.frame = CGRectMake(200, 210, 80, 30);
    button2.backgroundColor = [UIColor orangeColor];
    [button2 setTitle:@"注册" forState:UIControlStateNormal];
    [button2 addTarget:self action:@selector(registerAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button2];
    

    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(itemAction:)];
    self.navigationItem.leftBarButtonItem = item;
    self.title = @"用户登陆";
    
    
}
- (void)itemAction:(UIButton *)button {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
- (void)trueAction:(UIButton *)button {
    [self dismissViewControllerAnimated:YES completion:^{
    [self.delegate FiveWithstring:@"注销"];
    }];
}
- (void)registerAction:(UIButton *)button {
  
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
